Lasso Soft Inc. > Home

[string->encodeBash]

Linkstring->encodeBash
AuthorKyle Jessup
CategoryString
Version9.x
LicensePublic Domain
Posted29 Jan 2014
Updated29 Jan 2014
More by this author...

Description

Returns the string encoded such that it can be given to bash as a literal command line argument. Note that you won't need this for arguments by default if you are using sys_process.

Sample Usage

local(s = 'jdf""s%&$v
d')

#s->encodeBash

Result:
"jdf\"\"s%&\$v\
d"

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

define string->encodeBash() => '"'+regexp('([\\$`"\\\n])', `\\$1`, self)->replaceAll+'"'

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft